﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiMaterialTextureEntry : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiMaterialTextureEntry(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiMaterialTextureEntry_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiMaterialTextureEntry obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiMaterialTextureEntry()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiMaterialTextureEntry(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiMaterialTextureEntry cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialTextureEntry_cast(OdRxObject.getCPtr(pObj));
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMaterialTextureEntry_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMaterialTextureEntry_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiMaterialTextureEntry_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiMaterialTextureEntry createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialTextureEntry_createObject();
			OdGiMaterialTextureEntry result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureEntry)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiMaterialTextureData textureData()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiMaterialTextureEntry_textureData(this.swigCPtr);
			OdGiMaterialTextureData result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTextureData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTextureData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTextureData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isTextureInitialized()
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_isTextureInitialized(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint proceduralTextureWidth()
		{
			uint result = GlobalsPINVOKE.OdGiMaterialTextureEntry_proceduralTextureWidth(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setProceduralTextureWidth(uint width)
		{
			GlobalsPINVOKE.OdGiMaterialTextureEntry_setProceduralTextureWidth(this.swigCPtr, width);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual uint proceduralTextureHeight()
		{
			uint result = GlobalsPINVOKE.OdGiMaterialTextureEntry_proceduralTextureHeight(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setProceduralTextureHeight(uint height)
		{
			GlobalsPINVOKE.OdGiMaterialTextureEntry_setProceduralTextureHeight(this.swigCPtr, height);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setProceduralTextureResolution(uint width, uint height)
		{
			GlobalsPINVOKE.OdGiMaterialTextureEntry_setProceduralTextureResolution(this.swigCPtr, width, height);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual double proceduralTextureQuality()
		{
			double result = GlobalsPINVOKE.OdGiMaterialTextureEntry_proceduralTextureQuality(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setProceduralTextureQuality(double coef)
		{
			GlobalsPINVOKE.OdGiMaterialTextureEntry_setProceduralTextureQuality(this.swigCPtr, coef);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, OdGiMaterialMap matMap, OdGiMaterialTextureManager pManager)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_0(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), OdGiMaterialMap.getCPtr(matMap), OdGiMaterialTextureManager.getCPtr(pManager));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, OdGiMaterialMap matMap)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_1(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), OdGiMaterialMap.getCPtr(matMap));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, OdGiMaterialTexture pTexture, OdGiMaterialTextureManager pManager)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_2(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), OdGiMaterialTexture.getCPtr(pTexture), OdGiMaterialTextureManager.getCPtr(pManager));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, OdGiMaterialTexture pTexture)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_3(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), OdGiMaterialTexture.getCPtr(pTexture));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, string fileName, OdGiMaterialTextureManager pManager)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_4(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), fileName, OdGiMaterialTextureManager.getCPtr(pManager));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, string fileName)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_5(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), fileName);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, double opacity, OdGiMaterialTextureManager pManager)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_6(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), opacity, OdGiMaterialTextureManager.getCPtr(pManager));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setGiMaterialTexture(OdGiMaterialTextureData.DevDataVariant pDeviceInfo, OdRxClass pTexDataImpl, OdGiContext giCtx, double opacity)
		{
			bool result = GlobalsPINVOKE.OdGiMaterialTextureEntry_setGiMaterialTexture__SWIG_7(this.swigCPtr, OdGiMaterialTextureData.DevDataVariant.getCPtr(pDeviceInfo), OdRxClass.getCPtr(pTexDataImpl), OdGiContext.getCPtr(giCtx), opacity);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setTextureData(OdGiMaterialTextureData pTextureData, OdGiMaterialTextureManager pManager)
		{
			GlobalsPINVOKE.OdGiMaterialTextureEntry_setTextureData__SWIG_0(this.swigCPtr, OdGiMaterialTextureData.getCPtr(pTextureData), OdGiMaterialTextureManager.getCPtr(pManager));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setTextureData(OdGiMaterialTextureData pTextureData)
		{
			GlobalsPINVOKE.OdGiMaterialTextureEntry_setTextureData__SWIG_1(this.swigCPtr, OdGiMaterialTextureData.getCPtr(pTextureData));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
